#include <sys.h>
//#include <wdg.h>
//#include <Uart_Config.h>
#include <delay.h>
#include <usart.h>
#include <led.h>
//#include <timer.h>
#include <key.h>
//#include <exti.h>
#include <GPIO_config.h>
//#include <MY_ADC.h>
//#include <DAC.h>
#include <dma.h>
//#include <spi.h>
#include <I2C.h>
#include <RTC.h>
//#include <flash.h>

unsigned int SR = 0;

int main(void)
{
	//unsigned char t=0,data[24];
	//unsigned char Rx_Buf[24];
	unsigned short time = 1;

	Stm32_Clock_Init(9); //系统时钟使能
	delay_init(72);	     //延时函数配置
	
	LED_Init();
	uart_init(72,9600);  //串口使能
	KEY_Init();
	//TIM1_PWM_Init(7999,8999);//1Hz
	//PWM_val = 1000;
	//ADC1_Init();
	//Tri_generater_Init(0x0C);
	//DMA1_Init();
	//EXTI_Init();
	//IWDG_Init(7,0x00000FFF);
	//SPI1_Init();
	//SPI_Flash_Init();
	//IIC1_Init();
	if(RTC_Check())
		time = 400;
	else
		time = 1000;
	LED1 = 0;

	while(1)
	{
		delay_ms(time);
		LED0 = !LED0;
	} 
	//return 0;
}

